// pages/my/my.js
// import url from "../../utils/url"

Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.request({
      url: 'http://www.tenement.com/api/skx/getUserInif',
      data: {
        id: 2
      },
      method: "GET",
      success: res => {
        if (res.data.code != 30200) {
          wx.showToast({
            title: '获取失败',
            icon: 'error',
            duration: 2000
          })
        }
        //console.log(res.data.data);
        //如果res.data.code ==30200
        this.setData({
          userInfo: res.data.data
        })
      }
    })
  },

  //消息
  message(e) {
    let uid = e.currentTarget.dataset.id

    // console.log(uid);
    wx.navigateTo({
      url: '/pages/message/message?id=' + uid
    })
  },

  //到收藏页
  collect(e){
    let uid = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/collect/collect?id=' + uid
    })
  },
  //到浏览记录
  browse(e){
    let uid = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/browse/browse?id=' + uid
    })
  },

  look(){
    wx.makePhoneCall({
      phoneNumber: '15027933459',
    })
  }





})